<?php

require_once 'model/Data.php';

class Conexao extends Data{

    private $host = 'localhost';
    private $user = 'root';
    private $pass = '';
    private $db = "dnd";

    private function connect() {

        $conn = new PDO("mysql:host=$this->host;dbname=$this->db", $this->user, $this->pass);

        return $conn;
    }

    public function runQuery($sql) {
        $stmt = $this->connect()->prepare($sql);
        $stmt->execute();
    }
    
    public function runSelect($sql){
        $stmt = $this->connect()->prepare($sql);
        $stmt->execute();
        return $stmt->fetchAll(PDO::FETCH_ASSOC);
       
    }

}

?>
